package com.ubao.util;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.net.UnknownHostException;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.os.Environment;
import android.telephony.TelephonyManager;
import android.text.Html;
import android.util.Log;
import android.view.Display;
import android.view.ViewGroup.LayoutParams;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.ubao.R;


public class Helper {
	
	
	static String vkey="";

	
	
	public static void log_url(String log){
		Log.d("url", log);
	}
	
	public static void log_url(String hint , String log){
		Log.d("url", hint + log);
	}
	
	public static void Log_json(String json){
		Log.d("json", json);
	}
	
	public static void Log_json(String hint,String json){
		Log.d("json", hint + json);
	}
				
	
		public static String convertStreamToString(InputStream is) {   
	          
	        // To convert the InputStream to String we use the BufferedReader.readLine()  
	         // method. We iterate until the BufferedReader return null which means  
	         // there's no more data to read. Each line will appended to a StringBuilder  
	         //' and returned as String.  
	           
	     
	        try {  
	        	   BufferedReader reader = new BufferedReader(new InputStreamReader(is,"GB2312"));   
	               StringBuilder sb = new StringBuilder();   
	           
	               String line = null;   
	            while ((line = reader.readLine()) != null) {   
	                sb.append(line );   
	            } 
	            return sb.toString();   
	        } catch (Exception e) {   
	            e.printStackTrace();   
	        } finally {   
	            try {   
	                is.close();   
	            } catch (IOException e) {   
	                e.printStackTrace();   
	            }   
	        }
			return null;           
	    } 
	
	
	//����ͼƬ·��
	public static String saveBitmapToSdCard(String name,Bitmap bitmap) {
		String res = null;
		FileOutputStream fos = null;
		if (Environment.getExternalStorageState() != null) {
			try {
				File p = new File("/sdcard/DCIM/VELO/"); // ����Ŀ¼
				File f = new File("/sdcard/DCIM/VELO/" + name + ".png"); // �����ļ�
				if (!p.exists()) {
					p.mkdir();
				}
				if (!f.exists()) {
					f.createNewFile();
				}
				fos = new FileOutputStream(f);
				bitmap.compress(CompressFormat.JPEG, 100, fos);
				fos.close();
				res = f.getAbsolutePath();
			} catch (FileNotFoundException e) {
				res = "û���ҵ��ļ�";
				e.printStackTrace();
			} catch (Exception e) {
				res = "SD��δ��װ";
				e.printStackTrace();
			}
		}else{
			res = "��SD��";
		}
		return res;
	}

	
	
	//������ת�� XX|XX ��ʽ
		public static String getString(List parms)
		{
			String aa="";
			for (int i = 0; i < parms.size(); i++) {
				aa += parms.get(i).toString() + "_";
			}
			String str = aa.substring(0,
					aa.length() - 1);
	        System.out.println(str);
	       return str;
		}
	
		
	/**
	 * drawable--->bitmap drawableת��Ϊbitmap
	 * @param drawable
	 * @return Bitmap
	 */
	public static Bitmap drawableToBitmap(Drawable drawable) {  
		Bitmap bitmap = Bitmap  
		.createBitmap(  
				drawable.getIntrinsicWidth(),  
				drawable.getIntrinsicHeight(),  
				drawable.getOpacity() != PixelFormat.OPAQUE ? Bitmap.Config.ARGB_8888  
						: Bitmap.Config.RGB_565);  
		Canvas canvas = new Canvas(bitmap);  
//		//canvas.setBitmap(bitmap);  
		drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());  
		drawable.draw(canvas);  
		return bitmap;  
		
	}

	
	/**
	 * �ж�����
	 * @param str
	 * @return
	 */
	public static boolean isNumeric(String str){ 

		   Pattern pattern = Pattern.compile("[0-9]*"); 
		   Matcher isNum = pattern.matcher(str);
		   if( !isNum.matches() ){
		       return false; 
		   } 
		   return true; 
		}
	
	
	
	public static Bitmap getUri(String mUrl) {
		// TODO Auto-generated method stub
		try {
			URL url = new URL(mUrl);
			HttpURLConnection connection = (HttpURLConnection) url
					.openConnection();
			InputStream is = connection.getInputStream();
			Bitmap bitmap = BitmapFactory.decodeStream(is);
			return bitmap;
		} catch (Exception e) {
			e.printStackTrace();		
		}
		return null;
	}
	
	//ͼƬԲ��
	public static Bitmap toRoundCorner(Bitmap bitmap, int pixels) {       
		  Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888);   
		  Canvas canvas = new Canvas(output);          
		  final int color = 0xff424242;        
		  final Paint paint = new Paint();    
		  final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());  
		  final RectF rectF = new RectF(rect);      
		  final float roundPx = pixels; 
		  paint.setAntiAlias(true);      
		  canvas.drawARGB(0, 0, 0, 0);     
		  paint.setColor(color);      
		  canvas.drawRoundRect(rectF, roundPx, roundPx, paint);     
		  paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));    
		  canvas.drawBitmap(bitmap, rect, rect, paint);        
		  return output;    
		  }
	
	//����ͼƬ·��
			public static Map<String,File> saveSDCard(Bitmap photo){
				Map<String,File> map = null;
				try {
					map= new HashMap<String, File>();
					String filepath = "/sdcard/ubao_images";
					File files = new File(filepath);
					files.mkdir();
					String name=System.currentTimeMillis()
					+ ".jpg";
					File file = new File(filepath,name);
					
					FileOutputStream outStream = new FileOutputStream(file);
					String path = file.getAbsolutePath();
				
					photo.compress(CompressFormat.JPEG, 100, outStream);
					outStream.close();
					map.put(name, file);
				} catch (FileNotFoundException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				return map;
			}
			
	
		
			//ɾ���ļ���	
					public static void delSDCardListBitmap() {
						File file = new File("/sdcard/VELO_Images");
						if (file != null) {
							File[] files = file.listFiles();
							if (files != null) {
								for(int i = 0;i<files.length;i++)
								{
									files[i].delete();
								}
								
							}
						}
					}
		
	
	//����vkey               
//		public static  String vkeyBack(Object...args)
//		{
//			String allParas = "";
//			for(int i=0;i<args.length;i++)
//			{
//				allParas = allParas + args[i]  ;
//			}
////			System.out.println("allParas-->" + allParas);
////			System.out.println("md51--->" + MD5((allParas).toUpperCase()).toUpperCase());
//			vkey = MD5(MD5((allParas).toUpperCase()).toUpperCase()+Const.secret).toUpperCase();
////			System.out.println("vkey--->" + vkey);
//			return vkey; 
//		}
		
		
		 //��ȡ�ֻ�Ψһ��ʾ
	    public static String getPhoneID(Context context)
	    {
	    	 // //��ȡ�ֻ��Ψһ��ʶ
	    	 TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); 
	    	 String phoneMark = tm.getDeviceId();
			return phoneMark;
	    	 	
	    }
		
		//MD5������
		public  static String MD5(String inStr) {
			MessageDigest md5 = null;
			try {
				md5 = MessageDigest.getInstance("MD5");
			} catch (Exception e) {
				////System.out.println(e.toString());
				e.printStackTrace();
				return "";
			}
			char[] charArray = inStr.toCharArray();
			byte[] byteArray = new byte[charArray.length];

			for (int i = 0; i < charArray.length; i++)
				byteArray[i] = (byte) charArray[i];
			byte[] md5Bytes = md5.digest(byteArray);
			StringBuffer hexValue = new StringBuffer();
			for (int i = 0; i < md5Bytes.length; i++) {
				int val = ((int) md5Bytes[i]) & 0xff;
				if (val < 16)
					hexValue.append("0");
				hexValue.append(Integer.toHexString(val));
			}
			return hexValue.toString();
		}

		
		
		public static String getMD5(String instr) {
			String s = null;
			// 用来将字节转换成 16 进制表示的字�?
			char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
					'a', 'b', 'c', 'd', 'e', 'f' };
			try {
				java.security.MessageDigest md = java.security.MessageDigest
						.getInstance("MD5");
				md.update(instr.getBytes());
				byte tmp[] = md.digest(); // MD5 的计算结果是�?�� 128 位的长整数，
											// 用字节表示就�?16 个字�?
				char str[] = new char[16 * 2]; // 每个字节�?16 进制表示的话，使用两个字符，
												// �?��表示�?16 进制�?�� 32 个字�?
				int k = 0; // 表示转换结果中对应的字符位置
				for (int i = 0; i < 16; i++) { // 从第�?��字节�?��，对 MD5 的每�?��字节
												// 转换�?16 进制字符的转�?
					byte byte0 = tmp[i]; // 取第 i 个字�?
					str[k++] = hexDigits[byte0 >>> 4 & 0xf]; // 取字节中�?4 位的数字转换,
																// >>>
																// 为�?辑右移，将符号位�?��右移
					str[k++] = hexDigits[byte0 & 0xf]; // 取字节中�?4 位的数字转换
				}
				s = new String(str).toUpperCase(); // 换后的结果转换为字符�?

			} catch (Exception e) {

			}
			return s;
		}
		
		
		public static String getJsonString(String strURL) throws SocketTimeoutException,UnknownHostException,FileNotFoundException {
			StringBuffer json = new StringBuffer(); 
			HttpURLConnection conn = null;
			BufferedReader br = null; 
			try {
				URL url = new URL(strURL);
				conn = (HttpURLConnection) url.openConnection();
				conn.setReadTimeout(30*1000);
				InputStream is = conn.getInputStream();
				br = new BufferedReader(new InputStreamReader(is,"utf-8"));
				String temp = null;
				while((temp=br.readLine())!=null){
					json = json.append(temp);
				}
			}catch(SocketTimeoutException ste){
				Log.e("��ʱ", "��ʱ��");
					throw ste; 
			}catch(UnknownHostException h){
				Log.e("��·", "���粻��ͨ");
				throw h;
			}catch(FileNotFoundException fe){
				throw fe;
			}
			catch (Exception e) {
				e.printStackTrace();
				//conn.disconnect();
				try {
					if(br!=null){
						br.close(); 
						br = null;
					}
				} catch (IOException e1) {
					e1.printStackTrace(); 
				}
			}
			return json.toString(); 
		}
		
		/**
		 * ��ȡ��Ļ���
		 * @param activity
		 * @return
		 */
		public static int getWidth(Activity activity){
			Display display = activity.getWindowManager().getDefaultDisplay();
			return display.getWidth();
		}

		/**
		 * ��ȡ��Ļ�߶�
		 * @param activity
		 * @return
		 */
		public static int getHeight(Activity activity){
			Display display = activity.getWindowManager().getDefaultDisplay();
			return display.getHeight();
		}
//		/**
//		 * ��ʼ��΢��
//		 */
//		public static void initSystem(){
//			Weibo.CONSUMER_KEY = Const.KEY;
//			Weibo.CONSUMER_SECRET = Const.SECRET;
//			System.setProperty("weibo4j.oauth.consumerKey", Weibo.CONSUMER_KEY);   
//		    System.setProperty("weibo4j.oauth.consumerSecret", Weibo.CONSUMER_SECRET);   
//		}
		
		
		/**
		 * ɾ���ֶ�
		 * @param ctx
		 * @param title
		 */
		public static void deleteToSP(Context ctx , String title){
			SharedPreferences.Editor se = ctx.getSharedPreferences(title, Context.MODE_WORLD_WRITEABLE).edit();
			se.clear().commit();
		}
		
		/**
		 * �����ֶ�
		 * @param ctx
		 * @param title
		 * @param key
		 * @param value
		 */
		public static void saveToSP(Context ctx , String title,String key,String value){
			SharedPreferences.Editor se = ctx.getSharedPreferences(title, Context.MODE_WORLD_WRITEABLE).edit();
			se.putString(key, value);
			se.commit();
		}
		
		/**
		 * �����ֶ�
		 * @param ctx
		 * @param title
		 * @param key
		 * @return String ���δ�����򷵻�null
		 */
		public static String getFromSP(Context ctx , String title,String key){
			SharedPreferences se = ctx.getSharedPreferences(title, Context.MODE_WORLD_READABLE);
			if(se==null){
				return null;
			}
			String value = se.getString(key, "");
			if(value.equals("")){
				return null;
			}else{
				return value;
			}
		}

		/**
		 * ��ȡʱ��
		 * @param createtime
		 * @return
		 */
		public static String getTime(String createtime) {
			try {
				int year = Integer.parseInt(createtime.substring(0, 4));
				int month = Integer.parseInt(createtime.substring(4, 6))-1;
				int day = Integer.parseInt(createtime.substring(6, 8));
				int hour = Integer.parseInt(createtime.substring(8, 10));
				int minute = Integer.parseInt(createtime.substring(10, 12));
				int second = Integer.parseInt(createtime.substring(12, 14));
				GregorianCalendar gc = new GregorianCalendar(year, month, day, hour, minute, second);
				
				Date date = gc.getTime();
				long pass = date.getTime();
				long now = System.currentTimeMillis();
				GregorianCalendar gcNow = new GregorianCalendar();
				System.out.println("now-pass:" + ((now-pass)/1000/60/60));
				if((now-pass)/1000<60){
					return ((now-pass)/1000) + "����ǰ";
				}else if((now-pass)/1000/60<60){
					return ((now-pass)/1000/60) + "������ǰ";
				}else if((now-pass)/1000/60/60/24==0){
					if(gcNow.get(Calendar.DAY_OF_MONTH) == day){
						return "���� " + createtime.substring(8, 10) + ":" + createtime.substring(10, 12);
					}else{
						return  createtime.substring(4, 6) + "-" + 
						createtime.substring(6, 8) + " " + 
						createtime.substring(8, 10) + ":" + 
						createtime.substring(10, 12);
					}
				}
				else
				{
					return  createtime.substring(4, 6) + "-" + 
							createtime.substring(6, 8) + " " + 
							createtime.substring(8, 10) + ":" + 
							createtime.substring(10, 12);
				}
			} catch (Exception e) {
				e.printStackTrace();
				return "";
			}
		}
		
		/**
		 * 
		 * @param str
		 * @return
		 */
		//��ʽת��
		//�������:ת��ǰ���ַ�
		//�������:ת������ַ�
		public static String doFormat(String str){
			String newStr =  str
				.replaceAll("#line", "<br />")
				.replaceAll("#red-b", "<font color=\"#9b0033\"><b>")
				.replaceAll("\\*red-b", "</b></font>")
				
				.replaceAll("#red", "<font color=\"#9b0033\">")
				.replaceAll("\\*red", "</font>")
				
				.replaceAll("#b", "<font color='#000000'>")
				.replaceAll("\\*b", "</font>")
				
				.replaceAll("#url", "<url>")
				.replaceAll("\\*url", "</url>")
				
				.replaceAll("#big", "<font size=\"+1\">")
				.replaceAll("\\*big", "</font>")
				
				
				.replaceAll("#red-b-big", "<font color=\"red\" size=\"+1\"><b>")
				.replaceAll("\\*red-b-big", "</b></font>")
				
				.replaceAll("#blue", "<font color=\"blue\">")
				.replaceAll("\\*blue", "</font>")
				
				.replaceAll("#blue-b", "<font color=\"blue\"><b>")
				.replaceAll("\\*blue-b", "</b></font>")
				
				.replaceAll("#blue-b-big", "<font color=\"blue\" size=\"+1\"><b>")
				.replaceAll("\\*blue-b-big", "</b></font>")
				
				;
			 ////System.out.println(newStr);
			 return newStr;
		}
		
		/**
		 * �ж��ַ��Ƿ�Ϊ��
		 * @param str
		 * @return
		 */
		public static boolean isNull(String str){
			if(str==null||str.equals("")||str.equals("null")||str.equals("��")){
				return true;
			}else{
				return false;
			}
		}
		
		/**
		 * 
		 * @param context
		 * @param linearlayout
		 * @param str
		 * linearlayout��tag�д�ŵ���imageView������
		 * imageView��tag�д�ž���image��url
		 * imageView��id��0��ʼ
		 */
		public static void getLinearLayout(Context context,LinearLayout l,String str){
			l.removeAllViews();
			int count = 0;
			int id = 0;
			while(str.length()>0){
				if(str.contains("<url>")){
					String text = str.substring(0, str.indexOf("<url>"));
					if(text.length()>0){
						TextView tv = new TextView(context);
						tv.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
						tv.setText(Html.fromHtml(text));
						tv.setTextSize(16);
						tv.setTextColor(0xff2b2b2b);
						l.addView(tv);
					}
					
					str = str.substring(str.indexOf("<url>"));
					String img = str.substring(5,str.indexOf("</url>"));
					ImageView iv = new ImageView(context);
					iv.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
					iv.setScaleType(ScaleType.CENTER);
					iv.setId(id);
					id++;
					count++;
					iv.setTag(img);
					iv.setImageResource(R.drawable.ic_launcher);
					l.addView(iv);
					str = str.substring(str.indexOf("</url>")+6);
				}else{
					TextView tv = new TextView(context);
					tv.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
					tv.setText(Html.fromHtml(str));
					tv.setTextSize(16);
					tv.setTextColor(0xff2b2b2b);
					l.addView(tv);
					str  = "";
				}
			};
			l.setTag(count);
		}

		public static String getA(String business) {
			int index = business.indexOf('|');
			String a = business.substring(0,index);
			return a;
		}
		public static String getB(String business) {
			int index = business.indexOf('|');
			String a = business.substring(index+1,business.length());
			return a;
		}
		
		private static String VQbig = "��";
		private static String VQmiddle = "��";
		private static String VQsmall = "��";
		public static List<String> GetVQImage(int level)
	    {
	        List<String> VQimage = new ArrayList<String>();
	        //�ȼ�С��1���򷵻ؿ�ͼ��
	        /*if (level < 1)
	        {
	            return "";
	        }
	        else
	        {*/
	            //��ʱ����
	            int temp = 0;
	            //��ͼ����
	            int bignum = level / 16;
	            for (int i = 0; i < bignum; i++)
	            {
	                //VQimage += VQbig;
	            	VQimage.add(VQbig);
	            }
	            temp = level % 16;
	            int zhongnum = temp / 4;
	            for (int i = 0; i < zhongnum; i++)
	            {
	                //VQimage += VQmiddle;
	            	VQimage.add(VQmiddle);
	            }
	            int smallnum = temp % 4;
	            for (int i = 0; i < smallnum; i++)
	            {
	                //VQimage += VQsmall;
	            	VQimage.add(VQsmall);
	            }
	      //  }
	        return VQimage;
	    }


		public static String ChangeT(String string,String color) { 
			String str = "";
			String str1 = "";
			if(string.indexOf("[")!=-1){
				str = string.substring(0, string.indexOf("["));
				if((string.indexOf("]")+1)==string.length()){
					return str;
				}else{
					 str1 = string.substring(string.indexOf("]"+1), string.length());
				}
				return str + str1;
			}
			return ChangeHtml(string,color);
		}
		
		public static String ChangeHtml(String string,String color){
			string = Helper.ToDBC(string);
			if(string.indexOf("Http")!=-1){
				String finlstr = string.substring(0, string.indexOf("Http"))
				+"<font color=\"#" + color + "\">" 
				+ string.substring(string.indexOf("Http"), string.length())
				+ "</font>";
				return finlstr;
			}
			if(string.indexOf("http")!=-1){
				String finlstr = string.substring(0, string.indexOf("http"))
				+"<font color=\"#" + color + "\">" 
				+ string.substring(string.indexOf("http"), string.length())
				+ "</font>";
				return finlstr;
			}
			return string;
		}
		

		/**
	     * 
	     * ��ȡ��ǰ����İ汾�� ����
	     */
	    public static String getVersionName(Context ctx)
	    {
	    	String version = "";
	            // ��ȡpackagemanager��ʵ��
	            try {
					PackageManager packageManager = ctx.getPackageManager();
					// getPackageName()���㵱ǰ��İ���0����ǻ�ȡ�汾��Ϣ
					PackageInfo packInfo = packageManager.getPackageInfo(ctx.getPackageName(),0);
					version = packInfo.versionName;
				} catch (NameNotFoundException e) {
					e.printStackTrace();
				}
	            return version;
	    }
	    
	    /**
	     * �Ƿ���Լ��汾
	     * @param ctx
	     * @return
	     */
	    public static boolean canCheckVersion(Context ctx) {
			Calendar c = Calendar.getInstance();
			String data = c.get(Calendar.YEAR) + ":" + c.get(Calendar.MONTH)+":"+c.get(Calendar.DATE);
			String olddate = getFromSP(ctx, "title_data", "key_date");
			if(data.equals(olddate)){
				return false;
			}else{
				saveToSP(ctx, "title_data", "key_date", data);
				return true;
			}
		}
	    
/*	    �Ϻ�	1
	    ����	2
	    �Ͼ�	4
	    ����	8
	    ����	16
	    ����	32
	    ���	64
	    ����	128
	    ����	256
	    ����	512*/

	    public static String getCity(int i){
	    	String city = "";
	    	switch(i){
	    	case 1:
	    		city = "�Ϻ�";
	    		break;
	    	case 2:
	    		city = "����";
	    		break;
	    	case 4:
	    		city = "�Ͼ�";
	    		break;
	    	case 8:
	    		city = "����";
	    		break;
	    	case 16:
	    		city = "����";
	    		break;
	    	case 32:
	    		city = "����";
	    		break;
	    	case 64:
	    		city = "���";
	    		break;
	    	case 128:
	    		city = "����";
	    		break;
	    	case 256:
	    		city = "����";
	    		break;
	    	case 512:
	    		city = "����";
	    		break;
	    	default:
	    		city="�޳���";
	    	}
	    	return city;
	    }
	    
	    
	    public static String ToDBC(String input) {
	    	System.out.println("input-->" + input);
	    	input = StringFilter(input);
	    	System.out.println("input-->>" + input);
	    	   char[] c = input.toCharArray();
	    	   for (int i = 0; i< c.length; i++) {
	    	       if (c[i] == 12288) {
	    	         c[i] = (char) 32;
	    	         continue;
	    	       }if (c[i]> 65280&& c[i]< 65375)
	    	          c[i] = (char) (c[i] - 65248);
	    	       }
	    	   return new String(c);
	    	}
	    public static String StringFilter(String str){
	        str=str.replaceAll("��","[").replaceAll("��","]").replaceAll("��","!");//�滻���ı��
	        String regEx="[����]"; // ���������ַ�
	        Pattern p = Pattern.compile(regEx);
	        Matcher m = p.matcher(str);
	        return m.replaceAll("").trim();
	    }
	    
	    
	   

	
}
